﻿namespace IceCS.DesignPattern.Core.AdapterPattern.MultiMediaPlayer
{
    public class AudioPlayer : IMediaPlayer
    {
        private MediaAdapter _mediaAdapter;

        public AudioPlayer()
        {
            _mediaAdapter = new MediaAdapter();
        }
        public string Play(string audioType, string fileName)
        {
            audioType = audioType.ToLowerInvariant();
            switch (audioType)
            {
                case "mp3":
                    return $"Playing mp3 file.Name:{fileName}";
                case "mp4":
                    return _mediaAdapter.Play(audioType, fileName);
                case "vlc":
                    return _mediaAdapter.Play(audioType, fileName);
                default:
                    return "Invalid media. " + audioType + " format not supported";
            }
        }
    }
}
